home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / ds5000.md / RCS / scnhdr.h,v < prev    next >
Encoding:
Text File  |  1990-02-16  |  10.8 KB  |  368 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     90.02.16.12.53.35;  author douglis;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     89.08.01.15.38.09;  author douglis;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @original ultrix version
  22. @
  23.  
  24.  
  25. 1.2
  26. log
  27. @use sprite format with ifndefs at starts of files
  28. @
  29. text
  30. @/*
  31.  * $Header: /sprite/lib/forms/RCS/proto.h,v 1.2 89/01/07 04:12:44 rab Exp $ SPRITE (Berkeley)
  32.  */
  33.  
  34. #ifndef _SCNHDR
  35. #define _SCNHDR
  36.  
  37.  
  38. /*    @@(#)scnhdr.h    4.2    (ULTRIX)    8/9/88                      */
  39. #ifdef mips
  40. /* --------------------------------------------------- */
  41. /* | Copyright (c) 1986 MIPS Computer Systems, Inc.  | */
  42. /* | All Rights Reserved.                            | */
  43. /* --------------------------------------------------- */
  44. /* $Header: /sprite/src/lib/include/ds3100.md/RCS/scnhdr.h,v 1.1 89/08/01 15:38:09 douglis Exp Locker: douglis $ */
  45.  
  46. /*    Copyright (c) 1984 AT&T    */
  47. /*      All Rights Reserved      */
  48.  
  49. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  50. /*    The copyright notice above does not evidence any       */
  51. /*    actual or intended publication of such source code.    */
  52.  
  53. #if mips
  54. /*
  55.  * The entries that refer to line numbers are not used for line numbers on
  56.  * "mips" machines.  See symhdr.h for the entries to get to the line number
  57.  * table.  The entries that were for line numbers are used for gp tables on
  58.  * "mips" machines.  That is s_lnnoptr is the file ptr to the gp table and
  59.  * s_nlnno is the number of table entries.  See the end of this file for the
  60.  * structure.
  61.  */
  62. #endif
  63.  
  64. #ifdef LANGUAGE_C
  65. struct scnhdr {
  66.     char        s_name[8];    /* section name */
  67.     long        s_paddr;    /* physical address, aliased s_nlib */
  68.     long        s_vaddr;    /* virtual address */
  69.     long        s_size;        /* section size */
  70.     long        s_scnptr;    /* file ptr to raw data for section */
  71.     long        s_relptr;    /* file ptr to relocation */
  72.     long        s_lnnoptr;    /* file ptr to gp histogram */
  73.     unsigned short    s_nreloc;    /* number of relocation entries */
  74.     unsigned short    s_nlnno;    /* number of gp histogram entries */
  75.     long        s_flags;    /* flags */
  76.     };
  77.  
  78. #endif /* LANGUAGE_C */
  79. #ifdef LANGUAGE_PASCAL
  80. type
  81.   scnhdr = packed record
  82.       s_name : packed array[1..8] of char; /* section name             */
  83.       s_paddr : long;            /* physical address             */
  84.       s_vaddr : long;            /* virtual address             */
  85.       s_size : long;            /* section size              */
  86.       s_scnptr : long;            /* file ptr to raw data for section  */
  87.       s_relptr : long;            /* file ptr to relocation         */
  88.       s_lnnoptr : long;         /* file ptr to gp histogram         */
  89.       s_nreloc : ushort;        /* number of relocation entries      */
  90.       s_nlnno : ushort;         /* number of gp histogram entries    */
  91.       s_flags : long;            /* flags                 */
  92.     end {record};
  93. #endif /* LANGUAGE_PASCAL */
  94.  
  95. #ifdef mips
  96. /* SCNROUND is the size that sections are rounded off to */
  97. #ifdef LANGUAGE_C
  98. #define SCNROUND ((long)16)
  99. #endif /* LANGUAGE_C */
  100. #ifdef LANGUAGE_PASCAL
  101. #define SCNROUND (16)
  102. #endif /* LANGUAGE_PASCAL */
  103. #endif /* mips */
  104.  
  105. /* the number of shared libraries in a .lib section in an absolute output file
  106.  * is put in the s_paddr field of the .lib section header, the following define
  107.  * allows it to be referenced as s_nlib
  108.  */
  109.  
  110. #define s_nlib    s_paddr
  111. #define    SCNHDR    struct scnhdr
  112. #define    SCNHSZ    sizeof(SCNHDR)
  113.  
  114.  
  115.  
  116.  
  117. /*
  118.  * Define constants for names of "special" sections
  119.  */
  120.  
  121. #ifdef LANGUAGE_C
  122. #define    _TEXT    ".text"
  123. #define    _DATA    ".data"
  124. #define    _BSS    ".bss"
  125. #define    _TV    ".tv"
  126. #define _INIT ".init"
  127. #define _FINI ".fini"
  128. #define _LIB ".lib"
  129. #endif /* LANGUAGE_C */
  130. #ifdef LANGUAGE_PASCAL
  131. #ifdef PASTEL
  132. #define    _TEXT    ('.text'||chr(0))
  133. #define    _DATA    ('.data'||chr(0))
  134. #define    _BSS    ('.bss'||chr(0))
  135. #define    _TV    ('.tv'||chr(0))
  136. #define    _INIT    ('.init'||chr(0))
  137. #define    _FINI    ('.fini'||chr(0))
  138. #define    _LIB    ('.lib'||chr(0))
  139. #else
  140. #define    _TEXT    ".text\0"
  141. #define    _DATA    ".data\0"
  142. #define    _BSS    ".bss\0"
  143. #define    _TV    ".tv\0"
  144. #define    _INIT    ".init\0"
  145. #define    _FINI    ".fini\0"
  146. #define    _LIB    ".lib\0"
  147. #endif /* PASTEL */
  148. #endif /* LANGUAGE_PASCAL */
  149.  
  150. #if mips
  151. /*
  152.  * Mips names for read only data (.rdata), small data (.sdata) and small bss
  153.  * (.bss).  Small sections are used for global pointer relative data items.
  154.  */
  155. #ifdef LANGUAGE_C
  156. #define    _RDATA    ".rdata"
  157. #define    _SDATA    ".sdata"
  158. #define    _SBSS    ".sbss"
  159. #define _UCODE    ".ucode"
  160. #define _LIT8    ".lit8"
  161. #define _LIT4    ".lit4"
  162. #endif /* LANGUAGE_C */
  163. #ifdef LANGUAGE_PASCAL
  164. #ifdef PASTEL
  165. #define    _RDATA    ('.rdata'||chr(0))
  166. #define    _SDATA    ('.sdata'||chr(0))
  167. #define    _SBSS    ('.sbss'||chr(0))
  168. #define    _UCODE    ('.ucode'||chr(0))
  169. #define    _LIT8    ('.lit8'||chr(0))
  170. #define    _LIT4    ('.lit4'||chr(0))
  171. #else
  172. #define    _RDATA    ".rdata\0"
  173. #define    _SDATA    ".sdata\0"
  174. #define    _SBSS    ".sbss\0"
  175. #define    _UCODE    ".ucode\0"
  176. #define    _LIT8    ".lit8\0"
  177. #define    _LIT4    ".lit4\0"
  178. #endif /* PASTEL */
  179. #endif /* LANGUAGE_PASCAL */
  180. #endif
  181.  
  182.  
  183. /*
  184.  * The low 4 bits of s_flags is used as a section "type"
  185.  */
  186.  
  187. #ifdef LANGUAGE_C
  188. #define STYP_REG    0x00        /* "regular" section:
  189.                         allocated, relocated, loaded */
  190. #define STYP_DSECT    0x01        /* "dummy" section:
  191.                         not allocated, relocated,
  192.                         not loaded */
  193. #define STYP_NOLOAD    0x02        /* "noload" section:
  194.                         allocated, relocated,
  195.                          not loaded */
  196. #define STYP_GROUP    0x04        /* "grouped" section:
  197.                         formed of input sections */
  198. #define STYP_PAD    0x08        /* "padding" section:
  199.                         not allocated, not relocated,
  200.                          loaded */
  201. #define STYP_COPY    0x10        /* "copy" section:
  202.                         for decision function used
  203.                         by field update;  not
  204.                         allocated, not relocated,
  205.                         loaded;  reloc & lineno
  206.                         entries processed normally */
  207. #define    STYP_TEXT    0x20        /* section contains text only */
  208. #define STYP_DATA    0x40        /* section contains data only */
  209. #define STYP_BSS    0x80        /* section contains bss only */
  210. #if mips
  211. #define STYP_RDATA    0x100        /* section contains read only data */
  212. #define STYP_SDATA    0x200        /* section contains small data only */
  213. #define STYP_SBSS    0x400        /* section contains small bss only */
  214. #define STYP_UCODE    0x800        /* section only contains ucodes */
  215. #define STYP_LIT8    0x08000000    /* literal pool for 8 byte literals */
  216. #define STYP_LIT4    0x10000000    /* literal pool for 4 byte literals */
  217. #define S_NRELOC_OVFL    0x20000000    /* s_nreloc overflowed, the value is in
  218.                        v_addr of the first entry */
  219. #define STYP_LIB    0x40000000    /* section is a .lib section */
  220. #define STYP_INIT    0x80000000    /* section only contains the text
  221.                        instructions for the .init sec. */
  222. #else
  223. #define STYP_INFO    0x200        /* comment section : not allocated
  224.                         not relocated, not loaded */
  225. #define STYP_LIB    0x800        /* for .lib section : same as INFO */
  226. #define STYP_OVER    0x400        /* overlay section : relocated
  227.                         not allocated or loaded */
  228. #endif /* mips */
  229. #endif /* LANGUAGE_C */
  230. #ifdef LANGUAGE_PASCAL
  231. #define STYP_REG    16#00        /* "regular" section:
  232.                         allocated, relocated, loaded */
  233. #define STYP_DSECT    16#01        /* "dummy" section:
  234.                         not allocated, relocated,
  235.                         not loaded */
  236. #define STYP_NOLOAD    16#02        /* "noload" section:
  237.                         allocated, relocated,
  238.                          not loaded */
  239. #define STYP_GROUP    16#04        /* "grouped" section:
  240.                         formed of input sections */
  241. #define STYP_PAD    16#08        /* "padding" section:
  242.                         not allocated, not relocated,
  243.                          loaded */
  244. #define STYP_COPY    16#10        /* "copy" section:
  245.                         for decision function used
  246.                         by field update;  not
  247.                         allocated, not relocated,
  248.                         loaded;  reloc & lineno
  249.                         entries processed normally */
  250. #define    STYP_TEXT    16#20        /* section contains text only */
  251. #define STYP_DATA    16#40        /* section contains data only */
  252. #define STYP_BSS    16#80        /* section contains bss only */
  253. #if mips
  254. #define STYP_RDATA    16#100        /* section contains read only data */
  255. #define STYP_SDATA    16#200        /* section contains small data only */
  256. #define STYP_SBSS    16#400        /* section contains small bss only */
  257. #define STYP_UCODE    16#800        /* section only contains ucodes */
  258. #define STYP_LIT8    16#08000000    /* literal pool for 8 byte literals */
  259. #define STYP_LIT4    16#10000000    /* literal pool for 4 byte literals */
  260. #define S_NRELOC_OVFL    16#20000000    /* s_nreloc overflowed, the value is in
  261.                        v_addr of the first entry */
  262. #define STYP_LIB    16#40000000    /* section is a .lib section */
  263. #define STYP_INIT    16#80000000    /* section only contains the text
  264.                        instructions for the .init sec. */
  265. #else
  266. #define STYP_INFO    16#200        /* comment section : not allocated
  267.                         not relocated, not loaded */
  268. #define STYP_LIB    16#800        /* for .lib section : same as INFO */
  269. #define STYP_OVER    16#400        /* overlay section : relocated
  270.                         not allocated or loaded */
  271. #endif /* mips */
  272. #endif /* LANGUAGE_PASCAL */
  273.  
  274. /*
  275.  *  In a minimal file or an update file, a new function
  276.  *  (as compared with a replaced function) is indicated by S_NEWFCN
  277.  */
  278.  
  279. #define S_NEWFCN  0x100
  280.  
  281. /*
  282.  * In 3b Update Files (output of ogen), sections which appear in SHARED
  283.  * segments of the Pfile will have the S_SHRSEG flag set by ogen, to inform
  284.  * dufr that updating 1 copy of the proc. will update all process invocations.
  285.  */
  286.  
  287. #define S_SHRSEG    0x20
  288.  
  289. #if mips
  290. /*
  291.  * This table gives the section size corresponding to each applicable
  292.  * Gnum (always including 0), sorted by smallest size first. It is pointed to
  293.  * by the s_lnnoptr field in the section header and its number of entries
  294.  * (including the header) is in the s_nlnno field in the section header.
  295.  * This table only needs to exist for the .sdata and .sbss sections
  296.  * sections.  If there is no "small" section then the gp table for it is
  297.  * attached to the coresponding "large" section so the information still
  298.  * gets to the loader.
  299.  */
  300. #ifdef LANGUAGE_C
  301. union gp_table {
  302.   struct {
  303.     long current_g_value; /* actual value */
  304.     long unused;
  305.   } header;
  306.   struct {
  307.     long g_value; /* hypothetical value */
  308.     long bytes;    /* section size corresponding to hypothetical value */
  309.   } entry;
  310. };
  311. #define GPTAB    union gp_table
  312. #define GPTABSZ    sizeof(GPTAB)
  313.  
  314. #endif /* LANGUAGE_C */
  315.  
  316. #ifdef LANGUAGE_PASCAL
  317. type
  318.   gp_table = record
  319.     case boolean of
  320.       false: (current_g_value: integer; unused: integer);
  321.       true: (g_value: integer; bytes: integer);
  322.     end;
  323.   gpt_ptr = ^gp_table;
  324. #endif /* LANGUAGE_PASCAL */
  325.  
  326. #endif /* mips */
  327.  
  328. #ifdef mips
  329. /*
  330.  * This is the definition of a mips .lib section entry.  Note the size and
  331.  * offset are in sizeof(long)'s not bytes.
  332.  */
  333. #ifdef LANGUAGE_C
  334. struct libscn {
  335.     long    size;        /* size of this entry (including target name) */
  336.     long    offset;        /* offset from start of entry to target name  */
  337.     long    tsize;        /* text size in bytes, padded to DW boundary  */
  338.     long    dsize;        /* initialized data "        "    "  "   "       */
  339.     long    bsize;        /* uninitialized data "   "    "  "   "       */
  340.     long    text_start;    /* base of text used for this library          */
  341.     long    data_start;    /* base of data used for this library          */
  342.     long    bss_start;    /* base of bss used for this library          */
  343.     /* pathname of target shared library */
  344. };
  345.  
  346. #endif /* LANGUAGE_C */
  347.  
  348. #define    LIBSCN    struct libscn
  349. #define    LSCNSZ    sizeof(LIBSCN)
  350.  
  351. #endif /* mips */
  352. #endif /* mips */
  353. #endif /* _SCNHDR */
  354. @
  355.  
  356.  
  357. 1.1
  358. log
  359. @Initial revision
  360. @
  361. text
  362. @d1 8
  363. d15 1
  364. a15 1
  365. /* $Header: scnhdr.h,v 1031.2 88/05/16 14:39:56 bettina Exp $ */
  366. d324 1
  367. @
  368.